<!doctype html>
<html lang="zh-CN" data-theme="light">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <meta name="generator" content="VuePress 2.0.0-beta.68" />
    <meta name="theme" content="VuePress Theme Hope 2.0.0-beta.250" />
    <style>
      html {
        background: #fff;
      }

      html[data-theme="dark"] {
        background: #1d1e1f;
      }

      body {
        background: var(--bg-color);
      }
    </style>
    <script>
      const userMode = localStorage.getItem("vuepress-theme-hope-scheme");
      const systemDarkMode =
        window.matchMedia &&
        window.matchMedia("(prefers-color-scheme: dark)").matches;

      if (userMode === "dark" || (userMode !== "light" && systemDarkMode)) {
        document.documentElement.setAttribute("data-theme", "dark");
      }
    </script>
    <meta property="og:url" content="https://mister-hope.github.io/posts/technology/LInux%E8%BF%90%E7%BB%B4%E4%BD%BF%E7%94%A8%E7%9B%B8%E5%85%B3.html"><meta property="og:site_name" content="博客演示"><meta property="og:title" content="Linux常用命令整理"><meta property="og:description" content="Linux常用命令整理 多线程下载工具(axel) 安装： sudo apt-get install axel -y"><meta property="og:type" content="article"><meta property="og:locale" content="zh-CN"><meta property="og:updated_time" content="2023-11-11T17:37:01.000Z"><meta property="article:author" content="Lucosin"><meta property="article:modified_time" content="2023-11-11T17:37:01.000Z"><script type="application/ld+json">{"@context":"https://schema.org","@type":"Article","headline":"Linux常用命令整理","image":[""],"dateModified":"2023-11-11T17:37:01.000Z","author":[{"@type":"Person","name":"Lucosin","url":"https://lucosin.gitee.com"}]}</script><title>Linux常用命令整理 | 博客演示</title><meta name="description" content="Linux常用命令整理 多线程下载工具(axel) 安装： sudo apt-get install axel -y">
    <link rel="preload" href="/assets/style-1448e4fd.css" as="style"><link rel="stylesheet" href="/assets/style-1448e4fd.css">
    <link rel="modulepreload" href="/assets/app-924b25df.js"><link rel="modulepreload" href="/assets/LInux运维使用相关.html-14c3bfee.js"><link rel="modulepreload" href="/assets/plugin-vue_export-helper-c27b6911.js"><link rel="modulepreload" href="/assets/LInux运维使用相关.html-8f352f3a.js">
    <link rel="prefetch" href="/assets/index.html-9c1a5efe.js" as="script"><link rel="prefetch" href="/assets/intro.html-f190678a.js" as="script"><link rel="prefetch" href="/assets/slides.html-d06b1a48.js" as="script"><link rel="prefetch" href="/assets/index.html-868f56e3.js" as="script"><link rel="prefetch" href="/assets/disable.html-704b9480.js" as="script"><link rel="prefetch" href="/assets/encrypt.html-af6ba293.js" as="script"><link rel="prefetch" href="/assets/markdown.html-708fdea6.js" as="script"><link rel="prefetch" href="/assets/page.html-aee3b7e0.js" as="script"><link rel="prefetch" href="/assets/PyCharm内的SSH、SFTP、远程解释器、本地解释器，以及Development工具相关详解.html-3fbff06f.js" as="script"><link rel="prefetch" href="/assets/index.html-31118ed7.js" as="script"><link rel="prefetch" href="/assets/tacotron2版本迁移.html-8eafc05b.js" as="script"><link rel="prefetch" href="/assets/【新】基于Docker的开发环境使用.html-0819bf8c.js" as="script"><link rel="prefetch" href="/assets/📀使用GoogleCloab反向推送数据集到有公网IP的服务器.html-7508fc29.js" as="script"><link rel="prefetch" href="/assets/404.html-31977b04.js" as="script"><link rel="prefetch" href="/assets/index.html-eb55ea51.js" as="script"><link rel="prefetch" href="/assets/index.html-fa4ed37f.js" as="script"><link rel="prefetch" href="/assets/index.html-22eecf41.js" as="script"><link rel="prefetch" href="/assets/index.html-cbb352d2.js" as="script"><link rel="prefetch" href="/assets/index.html-0c6b398b.js" as="script"><link rel="prefetch" href="/assets/index.html-d344b251.js" as="script"><link rel="prefetch" href="/assets/index.html-84e744c0.js" as="script"><link rel="prefetch" href="/assets/index.html-2bc85cd0.js" as="script"><link rel="prefetch" href="/assets/index.html-a96ebe44.js" as="script"><link rel="prefetch" href="/assets/index.html-1c5faf15.js" as="script"><link rel="prefetch" href="/assets/index.html-7b182d6d.js" as="script"><link rel="prefetch" href="/assets/index.html-42afa099.js" as="script"><link rel="prefetch" href="/assets/index.html-014e6189.js" as="script"><link rel="prefetch" href="/assets/index.html-31eab3c4.js" as="script"><link rel="prefetch" href="/assets/index.html-5a3b860c.js" as="script"><link rel="prefetch" href="/assets/intro.html-d496737e.js" as="script"><link rel="prefetch" href="/assets/slides.html-131f05c5.js" as="script"><link rel="prefetch" href="/assets/index.html-7fbbbea3.js" as="script"><link rel="prefetch" href="/assets/disable.html-5fd3de21.js" as="script"><link rel="prefetch" href="/assets/encrypt.html-49b2cace.js" as="script"><link rel="prefetch" href="/assets/markdown.html-d15c2efc.js" as="script"><link rel="prefetch" href="/assets/page.html-4183c471.js" as="script"><link rel="prefetch" href="/assets/PyCharm内的SSH、SFTP、远程解释器、本地解释器，以及Development工具相关详解.html-261b3c39.js" as="script"><link rel="prefetch" href="/assets/index.html-8e3655f1.js" as="script"><link rel="prefetch" href="/assets/tacotron2版本迁移.html-92129634.js" as="script"><link rel="prefetch" href="/assets/【新】基于Docker的开发环境使用.html-9f13f801.js" as="script"><link rel="prefetch" href="/assets/📀使用GoogleCloab反向推送数据集到有公网IP的服务器.html-cdc77f80.js" as="script"><link rel="prefetch" href="/assets/404.html-52f84b45.js" as="script"><link rel="prefetch" href="/assets/index.html-4710c2f9.js" as="script"><link rel="prefetch" href="/assets/index.html-c98a99aa.js" as="script"><link rel="prefetch" href="/assets/index.html-1a65e4d7.js" as="script"><link rel="prefetch" href="/assets/index.html-e4a21696.js" as="script"><link rel="prefetch" href="/assets/index.html-dfcf459a.js" as="script"><link rel="prefetch" href="/assets/index.html-f7b12022.js" as="script"><link rel="prefetch" href="/assets/index.html-fb1291ac.js" as="script"><link rel="prefetch" href="/assets/index.html-bc9acf1c.js" as="script"><link rel="prefetch" href="/assets/index.html-4bb8a4e1.js" as="script"><link rel="prefetch" href="/assets/index.html-f8b90803.js" as="script"><link rel="prefetch" href="/assets/index.html-d7c4a687.js" as="script"><link rel="prefetch" href="/assets/index.html-47e89261.js" as="script"><link rel="prefetch" href="/assets/index.html-682dc9e8.js" as="script"><link rel="prefetch" href="/assets/index.html-a2c50954.js" as="script"><link rel="prefetch" href="/assets/photoswipe.esm-1464cdb9.js" as="script"><link rel="prefetch" href="/assets/pageview-7fa6fa87.js" as="script">
  </head>
  <body>
    <div id="app"><!--[--><!--[--><!--[--><span tabindex="-1"></span><a href="#main-content" class="vp-skip-link sr-only">跳至主要內容</a><!--]--><div class="theme-container has-toc"><!--[--><header id="navbar" class="vp-navbar"><div class="vp-navbar-start"><button type="button" class="vp-toggle-sidebar-button" title="Toggle Sidebar"><span class="icon"></span></button><!--[--><!----><!--]--><!--[--><a class="vp-link vp-brand vp-brand" href="/"><img class="vp-nav-logo" src="/logo.svg" alt="博客演示"><!----><span class="vp-site-name hide-in-pad">博客演示</span></a><!--]--><!--[--><!----><!--]--></div><div class="vp-navbar-center"><!--[--><!----><!--]--><!--[--><nav class="vp-nav-links"><div class="nav-item hide-in-mobile"><a aria-label="主页" class="vp-link nav-link nav-link" href="/"><span class="font-icon icon fa-fw fa-sm fas fa-home" style=""></span>主页<!----></a></div><div class="nav-item hide-in-mobile"><div class="dropdown-wrapper"><button type="button" class="dropdown-title" aria-label="文章"><span class="title"><span class="font-icon icon fa-fw fa-sm fas fa-pen-to-square" style=""></span>文章</span><span class="arrow"></span><ul class="nav-dropdown"><li class="dropdown-item"><h4 class="dropdown-subtitle"><span>Linux运维相关</span></h4><ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a aria-label="Linux运维常用命令" class="vp-link nav-link active nav-link active" href="/posts/technology/LInux%E8%BF%90%E7%BB%B4%E4%BD%BF%E7%94%A8%E7%9B%B8%E5%85%B3.html"><span class="font-icon icon fa-fw fa-sm fas fa-pen-to-square" style=""></span>Linux运维常用命令<!----></a></li></ul></li><li class="dropdown-item"><h4 class="dropdown-subtitle"><span>服务器使用相关</span></h4><ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a aria-label="基于Docker的开发环境使用" class="vp-link nav-link nav-link" href="/posts/server/%E3%80%90%E6%96%B0%E3%80%91%E5%9F%BA%E4%BA%8EDocker%E7%9A%84%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E4%BD%BF%E7%94%A8.html"><span class="font-icon icon fa-fw fa-sm fas fa-pen-to-square" style=""></span>基于Docker的开发环境使用<!----></a></li></ul></li></ul></button></div></div></nav><!--]--><!--[--><!----><!--]--></div><div class="vp-navbar-end"><!--[--><!----><!--]--><!--[--><!----><div class="nav-item vp-repo"><a class="vp-repo-link" href="https://github.com/vuepress-theme-hope/vuepress-theme-hope" target="_blank" rel="noopener noreferrer" aria-label="GitHub"><svg xmlns="http://www.w3.org/2000/svg" class="icon github-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="github icon" style="width:1.25rem;height:1.25rem;vertical-align:middle;"><path d="M511.957 21.333C241.024 21.333 21.333 240.981 21.333 512c0 216.832 140.544 400.725 335.574 465.664 24.49 4.395 32.256-10.07 32.256-23.083 0-11.69.256-44.245 0-85.205-136.448 29.61-164.736-64.64-164.736-64.64-22.315-56.704-54.4-71.765-54.4-71.765-44.587-30.464 3.285-29.824 3.285-29.824 49.195 3.413 75.179 50.517 75.179 50.517 43.776 75.008 114.816 53.333 142.762 40.79 4.523-31.66 17.152-53.377 31.19-65.537-108.971-12.458-223.488-54.485-223.488-242.602 0-53.547 19.114-97.323 50.517-131.67-5.035-12.33-21.93-62.293 4.779-129.834 0 0 41.258-13.184 134.912 50.346a469.803 469.803 0 0 1 122.88-16.554c41.642.213 83.626 5.632 122.88 16.554 93.653-63.488 134.784-50.346 134.784-50.346 26.752 67.541 9.898 117.504 4.864 129.834 31.402 34.347 50.474 78.123 50.474 131.67 0 188.586-114.73 230.016-224.042 242.09 17.578 15.232 33.578 44.672 33.578 90.454v135.85c0 13.142 7.936 27.606 32.854 22.87C862.25 912.597 1002.667 728.747 1002.667 512c0-271.019-219.648-490.667-490.71-490.667z"></path></svg></a></div><div class="nav-item hide-in-mobile"><button type="button" id="appearance-switch"><svg xmlns="http://www.w3.org/2000/svg" class="icon auto-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="auto icon" style="display:block;"><path d="M512 992C246.92 992 32 777.08 32 512S246.92 32 512 32s480 214.92 480 480-214.92 480-480 480zm0-840c-198.78 0-360 161.22-360 360 0 198.84 161.22 360 360 360s360-161.16 360-360c0-198.78-161.22-360-360-360zm0 660V212c165.72 0 300 134.34 300 300 0 165.72-134.28 300-300 300z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" class="icon dark-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="dark icon" style="display:none;"><path d="M524.8 938.667h-4.267a439.893 439.893 0 0 1-313.173-134.4 446.293 446.293 0 0 1-11.093-597.334A432.213 432.213 0 0 1 366.933 90.027a42.667 42.667 0 0 1 45.227 9.386 42.667 42.667 0 0 1 10.24 42.667 358.4 358.4 0 0 0 82.773 375.893 361.387 361.387 0 0 0 376.747 82.774 42.667 42.667 0 0 1 54.187 55.04 433.493 433.493 0 0 1-99.84 154.88 438.613 438.613 0 0 1-311.467 128z"></path></svg><svg xmlns="http://www.w3.org/2000/svg" class="icon light-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="light icon" style="display:none;"><path d="M952 552h-80a40 40 0 0 1 0-80h80a40 40 0 0 1 0 80zM801.88 280.08a41 41 0 0 1-57.96-57.96l57.96-58a41.04 41.04 0 0 1 58 58l-58 57.96zM512 752a240 240 0 1 1 0-480 240 240 0 0 1 0 480zm0-560a40 40 0 0 1-40-40V72a40 40 0 0 1 80 0v80a40 40 0 0 1-40 40zm-289.88 88.08-58-57.96a41.04 41.04 0 0 1 58-58l57.96 58a41 41 0 0 1-57.96 57.96zM192 512a40 40 0 0 1-40 40H72a40 40 0 0 1 0-80h80a40 40 0 0 1 40 40zm30.12 231.92a41 41 0 0 1 57.96 57.96l-57.96 58a41.04 41.04 0 0 1-58-58l58-57.96zM512 832a40 40 0 0 1 40 40v80a40 40 0 0 1-80 0v-80a40 40 0 0 1 40-40zm289.88-88.08 58 57.96a41.04 41.04 0 0 1-58 58l-57.96-58a41 41 0 0 1 57.96-57.96z"></path></svg></button></div><!----><!--]--><!--[--><!----><!--]--><button type="button" class="vp-toggle-navbar-button" aria-label="Toggle Navbar" aria-expanded="false" aria-controls="nav-screen"><span><span class="vp-top"></span><span class="vp-middle"></span><span class="vp-bottom"></span></span></button></div></header><!----><!--]--><!----><div class="toggle-sidebar-wrapper"><span class="arrow start"></span></div><aside id="sidebar" class="vp-sidebar"><!--[--><!----><!--]--><ul class="vp-sidebar-links"><li><section class="vp-sidebar-group"><p class="vp-sidebar-heading clickable active"><span class="font-icon icon fa-fw fa-sm fas fa-server" style=""></span><a aria-label="Linux运维" class="vp-link nav-link active vp-sidebar-title nav-link active vp-sidebar-title" href="/posts/technology/"><!---->Linux运维<!----></a><!----></p><ul class="vp-sidebar-links"><li><!--[--><a aria-label="Linux常用命令整理" class="vp-link nav-link active vp-sidebar-link vp-sidebar-page active nav-link active vp-sidebar-link vp-sidebar-page active" href="/posts/technology/LInux%E8%BF%90%E7%BB%B4%E4%BD%BF%E7%94%A8%E7%9B%B8%E5%85%B3.html"><!---->Linux常用命令整理<!----></a><ul class="vp-sidebar-sub-headers"><li class="vp-sidebar-sub-header"><a aria-label="多线程下载工具(axel)" class="vp-link nav-link vp-sidebar-link vp-heading nav-link vp-sidebar-link vp-heading" href="/posts/technology/LInux%E8%BF%90%E7%BB%B4%E4%BD%BF%E7%94%A8%E7%9B%B8%E5%85%B3.html#多线程下载工具-axel"><!---->多线程下载工具(axel)<!----></a><ul class="vp-sidebar-sub-headers"></ul></li><li class="vp-sidebar-sub-header"><a aria-label="screen(后台跑程序)" class="vp-link nav-link vp-sidebar-link vp-heading nav-link vp-sidebar-link vp-heading" href="/posts/technology/LInux%E8%BF%90%E7%BB%B4%E4%BD%BF%E7%94%A8%E7%9B%B8%E5%85%B3.html#screen-后台跑程序"><!---->screen(后台跑程序)<!----></a><ul class="vp-sidebar-sub-headers"></ul></li><li class="vp-sidebar-sub-header"><a aria-label="nohup(后台跑程序)" class="vp-link nav-link vp-sidebar-link vp-heading nav-link vp-sidebar-link vp-heading" href="/posts/technology/LInux%E8%BF%90%E7%BB%B4%E4%BD%BF%E7%94%A8%E7%9B%B8%E5%85%B3.html#nohup-后台跑程序"><!---->nohup(后台跑程序)<!----></a><ul class="vp-sidebar-sub-headers"></ul></li><li class="vp-sidebar-sub-header"><a aria-label="Anaconda清理缓存" class="vp-link nav-link vp-sidebar-link vp-heading nav-link vp-sidebar-link vp-heading" href="/posts/technology/LInux%E8%BF%90%E7%BB%B4%E4%BD%BF%E7%94%A8%E7%9B%B8%E5%85%B3.html#anaconda清理缓存"><!---->Anaconda清理缓存<!----></a><ul class="vp-sidebar-sub-headers"></ul></li><li class="vp-sidebar-sub-header"><a aria-label="查看当前目录占用空间" class="vp-link nav-link vp-sidebar-link vp-heading nav-link vp-sidebar-link vp-heading" href="/posts/technology/LInux%E8%BF%90%E7%BB%B4%E4%BD%BF%E7%94%A8%E7%9B%B8%E5%85%B3.html#查看当前目录占用空间"><!---->查看当前目录占用空间<!----></a><ul class="vp-sidebar-sub-headers"></ul></li><li class="vp-sidebar-sub-header"><a aria-label="实时监控网速(需要安装)" class="vp-link nav-link vp-sidebar-link vp-heading nav-link vp-sidebar-link vp-heading" href="/posts/technology/LInux%E8%BF%90%E7%BB%B4%E4%BD%BF%E7%94%A8%E7%9B%B8%E5%85%B3.html#实时监控网速-需要安装"><!---->实时监控网速(需要安装)<!----></a><ul class="vp-sidebar-sub-headers"><li class="vp-sidebar-sub-header"><a aria-label="iptables 开放指定端口段的入口" class="vp-link nav-link vp-sidebar-link vp-heading nav-link vp-sidebar-link vp-heading" href="/posts/technology/LInux%E8%BF%90%E7%BB%B4%E4%BD%BF%E7%94%A8%E7%9B%B8%E5%85%B3.html#iptables-开放指定端口段的入口"><!---->iptables 开放指定端口段的入口<!----></a><ul class="vp-sidebar-sub-headers"></ul></li><li class="vp-sidebar-sub-header"><a aria-label="tar相关" class="vp-link nav-link vp-sidebar-link vp-heading nav-link vp-sidebar-link vp-heading" href="/posts/technology/LInux%E8%BF%90%E7%BB%B4%E4%BD%BF%E7%94%A8%E7%9B%B8%E5%85%B3.html#tar相关"><!---->tar相关<!----></a><ul class="vp-sidebar-sub-headers"></ul></li><li class="vp-sidebar-sub-header"><a aria-label="CUDA配置到环境变量(切换cuda版本同理)" class="vp-link nav-link vp-sidebar-link vp-heading nav-link vp-sidebar-link vp-heading" href="/posts/technology/LInux%E8%BF%90%E7%BB%B4%E4%BD%BF%E7%94%A8%E7%9B%B8%E5%85%B3.html#cuda配置到环境变量-切换cuda版本同理"><!---->CUDA配置到环境变量(切换cuda版本同理)<!----></a><ul class="vp-sidebar-sub-headers"></ul></li><li class="vp-sidebar-sub-header"><a aria-label="添加 删除用户" class="vp-link nav-link vp-sidebar-link vp-heading nav-link vp-sidebar-link vp-heading" href="/posts/technology/LInux%E8%BF%90%E7%BB%B4%E4%BD%BF%E7%94%A8%E7%9B%B8%E5%85%B3.html#添加-删除用户"><!---->添加 删除用户<!----></a><ul class="vp-sidebar-sub-headers"></ul></li><li class="vp-sidebar-sub-header"><a aria-label="scp命令(服务器之间互相传文件)" class="vp-link nav-link vp-sidebar-link vp-heading nav-link vp-sidebar-link vp-heading" href="/posts/technology/LInux%E8%BF%90%E7%BB%B4%E4%BD%BF%E7%94%A8%E7%9B%B8%E5%85%B3.html#scp命令-服务器之间互相传文件"><!---->scp命令(服务器之间互相传文件)<!----></a><ul class="vp-sidebar-sub-headers"></ul></li></ul></li></ul><!--]--></li></ul></section></li><li><section class="vp-sidebar-group"><p class="vp-sidebar-heading clickable"><span class="font-icon icon fa-fw fa-sm fas fa-server" style=""></span><a aria-label="服务器相关" class="vp-link nav-link vp-sidebar-title nav-link vp-sidebar-title" href="/posts/server/"><!---->服务器相关<!----></a><!----></p><ul class="vp-sidebar-links"></ul></section></li></ul><!--[--><!----><!--]--></aside><!--[--><main id="main-content" class="vp-page"><!--[--><!--[--><!----><!--]--><!----><nav class="vp-breadcrumb disable"></nav><div class="vp-page-title"><h1><!---->Linux常用命令整理</h1><div class="page-info"><span class="page-author-info" aria-label="作者🖊" data-balloon-pos="down"><svg xmlns="http://www.w3.org/2000/svg" class="icon author-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="author icon"><path d="M649.6 633.6c86.4-48 147.2-144 147.2-249.6 0-160-128-288-288-288s-288 128-288 288c0 108.8 57.6 201.6 147.2 249.6-121.6 48-214.4 153.6-240 288-3.2 9.6 0 19.2 6.4 25.6 3.2 9.6 12.8 12.8 22.4 12.8h704c9.6 0 19.2-3.2 25.6-12.8 6.4-6.4 9.6-16 6.4-25.6-25.6-134.4-121.6-240-243.2-288z"></path></svg><span><a class="page-author-item" href="https://lucosin.gitee.com" target="_blank" rel="noopener noreferrer">Lucosin</a></span><span property="author" content="Lucosin"></span></span><!----><span class="page-date-info" aria-label="写作日期📅" data-balloon-pos="down"><svg xmlns="http://www.w3.org/2000/svg" class="icon calendar-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="calendar icon"><path d="M716.4 110.137c0-18.753-14.72-33.473-33.472-33.473-18.753 0-33.473 14.72-33.473 33.473v33.473h66.993v-33.473zm-334.87 0c0-18.753-14.72-33.473-33.473-33.473s-33.52 14.72-33.52 33.473v33.473h66.993v-33.473zm468.81 33.52H716.4v100.465c0 18.753-14.72 33.473-33.472 33.473a33.145 33.145 0 01-33.473-33.473V143.657H381.53v100.465c0 18.753-14.72 33.473-33.473 33.473a33.145 33.145 0 01-33.473-33.473V143.657H180.6A134.314 134.314 0 0046.66 277.595v535.756A134.314 134.314 0 00180.6 947.289h669.74a134.36 134.36 0 00133.94-133.938V277.595a134.314 134.314 0 00-133.94-133.938zm33.473 267.877H147.126a33.145 33.145 0 01-33.473-33.473c0-18.752 14.72-33.473 33.473-33.473h736.687c18.752 0 33.472 14.72 33.472 33.473a33.145 33.145 0 01-33.472 33.473z"></path></svg><span><!----></span><meta property="datePublished" content="2023-11-11T17:37:01.000Z"></span><!----><span class="page-reading-time-info" aria-label="阅读时间⌛" data-balloon-pos="down"><svg xmlns="http://www.w3.org/2000/svg" class="icon timer-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="timer icon"><path d="M799.387 122.15c4.402-2.978 7.38-7.897 7.38-13.463v-1.165c0-8.933-7.38-16.312-16.312-16.312H256.33c-8.933 0-16.311 7.38-16.311 16.312v1.165c0 5.825 2.977 10.874 7.637 13.592 4.143 194.44 97.22 354.963 220.201 392.763-122.204 37.542-214.893 196.511-220.2 389.397-4.661 5.049-7.638 11.651-7.638 19.03v5.825h566.49v-5.825c0-7.379-2.849-13.981-7.509-18.9-5.049-193.016-97.867-351.985-220.2-389.527 123.24-37.67 216.446-198.453 220.588-392.892zM531.16 450.445v352.632c117.674 1.553 211.787 40.778 211.787 88.676H304.097c0-48.286 95.149-87.382 213.728-88.676V450.445c-93.077-3.107-167.901-81.297-167.901-177.093 0-8.803 6.99-15.793 15.793-15.793 8.803 0 15.794 6.99 15.794 15.793 0 80.261 63.69 145.635 142.01 145.635s142.011-65.374 142.011-145.635c0-8.803 6.99-15.793 15.794-15.793s15.793 6.99 15.793 15.793c0 95.019-73.789 172.82-165.96 177.093z"></path></svg><span>大约 2 分钟</span><meta property="timeRequired" content="PT2M"></span><!----><!----></div><hr></div><div class="toc-place-holder"><aside id="toc"><!--[--><!----><!--]--><div class="toc-header">此页内容<button type="button" class="print-button" title="打印"><svg xmlns="http://www.w3.org/2000/svg" class="icon print-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="print icon"><path d="M819.2 364.8h-44.8V128c0-17.067-14.933-32-32-32H281.6c-17.067 0-32 14.933-32 32v236.8h-44.8C145.067 364.8 96 413.867 96 473.6v192c0 59.733 49.067 108.8 108.8 108.8h44.8V896c0 17.067 14.933 32 32 32h460.8c17.067 0 32-14.933 32-32V774.4h44.8c59.733 0 108.8-49.067 108.8-108.8v-192c0-59.733-49.067-108.8-108.8-108.8zM313.6 160h396.8v204.8H313.6V160zm396.8 704H313.6V620.8h396.8V864zM864 665.6c0 25.6-19.2 44.8-44.8 44.8h-44.8V588.8c0-17.067-14.933-32-32-32H281.6c-17.067 0-32 14.933-32 32v121.6h-44.8c-25.6 0-44.8-19.2-44.8-44.8v-192c0-25.6 19.2-44.8 44.8-44.8h614.4c25.6 0 44.8 19.2 44.8 44.8v192z"></path></svg></button></div><div class="toc-wrapper"><ul class="toc-list"><!--[--><li class="toc-item"><a class="vp-link toc-link level2 toc-link level2" href="#多线程下载工具-axel">多线程下载工具(axel)</a></li><!----><!--]--><!--[--><li class="toc-item"><a class="vp-link toc-link level2 toc-link level2" href="#screen-后台跑程序">screen(后台跑程序)</a></li><!----><!--]--><!--[--><li class="toc-item"><a class="vp-link toc-link level2 toc-link level2" href="#nohup-后台跑程序">nohup(后台跑程序)</a></li><!----><!--]--><!--[--><li class="toc-item"><a class="vp-link toc-link level2 toc-link level2" href="#anaconda清理缓存">Anaconda清理缓存</a></li><!----><!--]--><!--[--><li class="toc-item"><a class="vp-link toc-link level2 toc-link level2" href="#查看当前目录占用空间">查看当前目录占用空间</a></li><!----><!--]--><!--[--><li class="toc-item"><a class="vp-link toc-link level2 toc-link level2" href="#实时监控网速-需要安装">实时监控网速(需要安装)</a></li><li><ul class="toc-list"><!--[--><li class="toc-item"><a class="vp-link toc-link level3 toc-link level3" href="#iptables-开放指定端口段的入口">iptables 开放指定端口段的入口</a></li><!----><!--]--><!--[--><li class="toc-item"><a class="vp-link toc-link level3 toc-link level3" href="#tar相关">tar相关</a></li><!----><!--]--><!--[--><li class="toc-item"><a class="vp-link toc-link level3 toc-link level3" href="#cuda配置到环境变量-切换cuda版本同理">CUDA配置到环境变量(切换cuda版本同理)</a></li><!----><!--]--><!--[--><li class="toc-item"><a class="vp-link toc-link level3 toc-link level3" href="#添加-删除用户">添加 删除用户</a></li><!----><!--]--><!--[--><li class="toc-item"><a class="vp-link toc-link level3 toc-link level3" href="#scp命令-服务器之间互相传文件">scp命令(服务器之间互相传文件)</a></li><!----><!--]--></ul></li><!--]--></ul><div class="toc-marker" style="top:-1.7rem;"></div></div><!--[--><!----><!--]--></aside></div><!--[--><!----><!--]--><div class="theme-hope-content"><h1 id="linux常用命令整理" tabindex="-1"><a class="header-anchor" href="#linux常用命令整理" aria-hidden="true">#</a> <strong>Linux常用命令整理</strong></h1><h2 id="多线程下载工具-axel" tabindex="-1"><a class="header-anchor" href="#多线程下载工具-axel" aria-hidden="true">#</a> 多线程下载工具(axel)</h2><p>安装：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">apt-get</span> <span class="token function">install</span> axel <span class="token parameter variable">-y</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>使用：</p><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code>axel <span class="token parameter variable">-n</span> <span class="token number">16</span><span class="token punctuation">(</span>线程数<span class="token punctuation">)</span> <span class="token parameter variable">-o</span> ./<span class="token punctuation">[</span>当前操作目录下的目标文件名<span class="token punctuation">]</span> <span class="token punctuation">[</span>下载链接<span class="token punctuation">]</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="screen-后台跑程序" tabindex="-1"><a class="header-anchor" href="#screen-后台跑程序" aria-hidden="true">#</a> <strong>screen</strong>(后台跑程序)</h2><ul><li>新建一个屏幕(如果已存在则直接恢复该屏幕)：</li></ul><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">screen</span> <span class="token parameter variable">-R</span> <span class="token operator">&lt;</span>screen_name<span class="token operator">&gt;</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><ul><li><p>使当前屏幕切换到后台： ctrl +A D</p></li><li><p>退出当前屏幕： exit</p></li></ul><h2 id="nohup-后台跑程序" tabindex="-1"><a class="header-anchor" href="#nohup-后台跑程序" aria-hidden="true">#</a> nohup(后台跑程序)</h2><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">nohup</span> python my.py <span class="token operator">&gt;&gt;</span> log.log <span class="token operator"><span class="token file-descriptor important">2</span>&gt;</span><span class="token file-descriptor important">&amp;1</span> <span class="token operator">&amp;</span>
<span class="token function">nohup</span> python manage.py runserver <span class="token number">0.0</span>.0.0:8000 <span class="token operator">&gt;&gt;</span> turklelog.log <span class="token operator"><span class="token file-descriptor important">2</span>&gt;</span><span class="token file-descriptor important">&amp;1</span> <span class="token operator">&amp;</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="anaconda清理缓存" tabindex="-1"><a class="header-anchor" href="#anaconda清理缓存" aria-hidden="true">#</a> Anaconda清理缓存</h2><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code>conda clean <span class="token parameter variable">-p</span>
conda clean <span class="token parameter variable">--all</span> <span class="token parameter variable">-y</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="查看当前目录占用空间" tabindex="-1"><a class="header-anchor" href="#查看当前目录占用空间" aria-hidden="true">#</a> 查看当前目录占用空间</h2><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">du</span> <span class="token parameter variable">-sh</span> <span class="token punctuation">[</span>可选：目录路径<span class="token punctuation">]</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h2 id="实时监控网速-需要安装" tabindex="-1"><a class="header-anchor" href="#实时监控网速-需要安装" aria-hidden="true">#</a> 实时监控网速(需要安装)</h2><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code>ethstatus <span class="token parameter variable">-i</span> eno1np0
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><h3 id="iptables-开放指定端口段的入口" tabindex="-1"><a class="header-anchor" href="#iptables-开放指定端口段的入口" aria-hidden="true">#</a> iptables 开放指定端口段的入口</h3><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">sudo</span> iptables <span class="token parameter variable">-I</span> INPUT <span class="token parameter variable">-p</span> tcp <span class="token parameter variable">--dport</span> <span class="token number">15000</span>:25000 <span class="token parameter variable">-j</span> ACCEPT
<span class="token comment"># 持久化</span>
<span class="token function">sudo</span> netfilter-persistent save
<span class="token function">sudo</span> netfilter-persistent reload
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="tar相关" tabindex="-1"><a class="header-anchor" href="#tar相关" aria-hidden="true">#</a> tar相关</h3><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token comment"># 打包文件或文件夹(可以一次添加多个路径)</span>
<span class="token function">tar</span> <span class="token parameter variable">-cvf</span> <span class="token operator">&lt;</span>filename.tar<span class="token operator">&gt;</span> /<span class="token operator">&lt;</span>volume<span class="token operator"><span class="token file-descriptor important">1</span>&gt;</span>/ /<span class="token operator">&lt;</span>volume<span class="token operator"><span class="token file-descriptor important">2</span>&gt;</span>/<span class="token operator">&lt;</span>filename2.ext<span class="token operator">&gt;</span>
<span class="token comment"># 查看压缩包内容，但是不解压</span>
<span class="token function">tar</span> <span class="token parameter variable">-tvf</span> <span class="token operator">&lt;</span>filename.tar<span class="token operator">&gt;</span>
<span class="token comment"># 为压缩包追加文件或文件夹(同上)</span>
<span class="token function">tar</span> <span class="token parameter variable">-rvf</span> <span class="token operator">&lt;</span>filename.tar<span class="token operator">&gt;</span> /<span class="token operator">&lt;</span>volume<span class="token operator"><span class="token file-descriptor important">1</span>&gt;</span>/ /<span class="token operator">&lt;</span>volume<span class="token operator"><span class="token file-descriptor important">2</span>&gt;</span>/<span class="token operator">&lt;</span>filename2.ext<span class="token operator">&gt;</span>

<span class="token comment"># 解压文件至指定目录(不指定则为当前目录)</span>
<span class="token function">tar</span> <span class="token parameter variable">-xvf</span> <span class="token operator">&lt;</span>filename.tar<span class="token operator">&gt;</span> <span class="token parameter variable">-C</span> <span class="token operator">&lt;</span>volume<span class="token operator"><span class="token file-descriptor important">1</span>&gt;</span>/

<span class="token comment"># 创建归档文件并压缩</span>
<span class="token comment">#同打包，使用-zcpvf命令，但是后缀必须是.tar.gz或者.tgz</span>
<span class="token comment">#也可以使用-jcpvf 后缀.tar.bz2或者.tbz</span>
<span class="token comment">#https://blog.csdn.net/a460550542/article/details/127717553</span>

<span class="token function">ls</span> <span class="token operator">|</span> <span class="token function">xargs</span> <span class="token parameter variable">-I</span> <span class="token punctuation">{</span><span class="token punctuation">}</span> <span class="token function">tar</span> <span class="token parameter variable">-zcpvf</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>.tar.gz <span class="token punctuation">{</span><span class="token punctuation">}</span>

<span class="token function">nohup</span> <span class="token function">ls</span> <span class="token operator">|</span> <span class="token function">xargs</span> <span class="token parameter variable">-I</span> <span class="token punctuation">{</span><span class="token punctuation">}</span> <span class="token function">tar</span> <span class="token parameter variable">-zcpvf</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>.tar.gz <span class="token punctuation">{</span><span class="token punctuation">}</span> <span class="token operator">&gt;&gt;</span> log.log <span class="token operator"><span class="token file-descriptor important">2</span>&gt;</span><span class="token file-descriptor important">&amp;1</span> <span class="token operator">&amp;</span>

</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="cuda配置到环境变量-切换cuda版本同理" tabindex="-1"><a class="header-anchor" href="#cuda配置到环境变量-切换cuda版本同理" aria-hidden="true">#</a> CUDA配置到环境变量(切换cuda版本同理)</h3><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token comment"># 在bashrc文件内添加相应版本的cuda位置，如果只写cuda就是默认版本</span>
<span class="token comment"># 进入配置文件</span>
<span class="token function">vim</span> ~/.bashrc
 
<span class="token comment"># 添加以下两行</span>
<span class="token comment"># 在/.bashrc中配置LD_LIBRARY_PATH路径、配置PATH路径，完整配置如下：</span>
<span class="token builtin class-name">export</span> <span class="token assign-left variable">LD_LIBRARY_PATH</span><span class="token operator">=</span>/usr/local/cuda/lib
<span class="token builtin class-name">export</span> <span class="token assign-left variable"><span class="token environment constant">PATH</span></span><span class="token operator">=</span><span class="token environment constant">$PATH</span>:/usr/local/cuda/bin

<span class="token comment"># 更新配置文件</span>
<span class="token builtin class-name">source</span> ~/.bashrc

</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="添加-删除用户" tabindex="-1"><a class="header-anchor" href="#添加-删除用户" aria-hidden="true">#</a> 添加 删除用户</h3><div class="language-bash line-numbers-mode" data-ext="sh"><pre class="language-bash"><code><span class="token function">sudo</span> adduser <span class="token operator">&lt;</span>username<span class="token operator">&gt;</span>
<span class="token function">sudo</span> <span class="token function">userdel</span> <span class="token parameter variable">-r</span> <span class="token operator">&lt;</span>username<span class="token operator">&gt;</span>
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><h3 id="scp命令-服务器之间互相传文件" tabindex="-1"><a class="header-anchor" href="#scp命令-服务器之间互相传文件" aria-hidden="true">#</a> scp命令(服务器之间互相传文件)</h3><div class="language-lsshell line-numbers-mode" data-ext="lsshell"><pre class="language-lsshell"><code>scp -P 2200 (可选，非22端口时指定端口) -r local_folder/ username@remote_ip:/remote_folder/
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div></div><!--[--><!----><!--]--><footer class="page-meta"><div class="meta-item edit-link"><a href="https://github.com/vuepress-theme-hope/vuepress-theme-hope/edit/main/src/posts/technology/LInux运维使用相关.md" rel="noopener noreferrer" target="_blank" aria-label="在 GitHub 上编辑此页" class="nav-link label"><!--[--><svg xmlns="http://www.w3.org/2000/svg" class="icon edit-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="edit icon"><path d="M430.818 653.65a60.46 60.46 0 0 1-50.96-93.281l71.69-114.012 7.773-10.365L816.038 80.138A60.46 60.46 0 0 1 859.225 62a60.46 60.46 0 0 1 43.186 18.138l43.186 43.186a60.46 60.46 0 0 1 0 86.373L588.879 565.55l-8.637 8.637-117.466 68.234a60.46 60.46 0 0 1-31.958 11.229z"></path><path d="M728.802 962H252.891A190.883 190.883 0 0 1 62.008 771.98V296.934a190.883 190.883 0 0 1 190.883-192.61h267.754a60.46 60.46 0 0 1 0 120.92H252.891a69.962 69.962 0 0 0-69.098 69.099V771.98a69.962 69.962 0 0 0 69.098 69.098h475.911A69.962 69.962 0 0 0 797.9 771.98V503.363a60.46 60.46 0 1 1 120.922 0V771.98A190.883 190.883 0 0 1 728.802 962z"></path></svg><!--]-->在 GitHub 上编辑此页<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!----></a></div><div class="meta-item git-info"><div class="update-time"><span class="label">上次编辑于: </span><!----></div><div class="contributors"><span class="label">贡献者: </span><!--[--><!--[--><span class="contributor" title="email: 1299415013@qq.com">lucosin</span><!--]--><!--]--></div></div></footer><!----><!----><!--[--><!----><!--]--><!--]--></main><!--]--><footer class="vp-footer-wrapper"><div class="vp-footer">默认页脚</div><div class="vp-copyright">Copyright © 2023 Lucosin</div></footer></div><!--]--><!----><!--]--></div>
    <script type="module" src="/assets/app-924b25df.js" defer></script>
  </body>
</html>
